package com.scedu.controller;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//这里我们先导入controller接口
public class HelloController implements Controller {
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        //ModelAndView 模型和视图
        ModelAndView modelAndView = new ModelAndView();
        //封装对象，存放到ModelAndView中，
        modelAndView.addObject("msg","HEllo springMVC");
        modelAndView.setViewName("hello");
        return modelAndView;
    }
}
